﻿#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>

typedef double Real;

 

typedef struct
{
	int year;
	int hour;
}Context;
Context context = { 0 };

void read_data(Context* ctx)
{
	scanf("%d %d", &ctx->year, &ctx->hour);
}  

int get_hour_salary(int year)
{
	if (year >= 5)
		return 50;
	return 30;
}

float get_hours(int hour)
{
	if (hour <= 40)
		return hour;
	else
		return 40 + (hour - 40) * 1.5;
}

void solve(Context* ctx)
{
	float salary = get_hours(ctx->hour) * get_hour_salary(ctx->year);
	printf("%.2f\n", salary);
}

int main()
{
	freopen("D:/Develop/GitRepos/MOOC/浙江大学/数据结构/201906/DataStructure/M2019秋C入门和进阶练习集/7-174.txt", "r", stdin);
	read_data(&context);
	solve(&context);
	return 0;
}
